

var PageLoad =(function(){
	var d = document,wh = function(){return {h:d.documentElement.clientHeight,w:d.documentElement.clientWidth}},$ = function(id){return d.getElementById(id)},
	lm = $('menupag'),main = $('main')
	
	var target = document.getElementById("menupag"); 
	var r = target.getElementsByTagName("div");
	var dis = filterDis(r);
	var head_ul = document.getElementById("nav_ul");
	var head_li = head_ul.getElementsByTagName('li');
	
	return {
		resize:function(){
			var s = wh();
			lm.style.height = s.h-129+35+'px';
			main.style.height = s.h-107+35+'px'
			main.style.width = s.w - (lm.offsetWidth||170) - 10 + 'px';
	    },
	    goAction:function(n){
	    	var o = dis[n]; li = head_li[n];
	    	PageLoad.displayLi(n);
	    	PageLoad.displayPag(n);
	    	var r = o.getElementsByTagName("a");
	    	var a = r[0];
		    if(a){
		    	util.each(r,function(e){e.className=""});
		    	a.className="cur";
		    	var url=a.href||a.getAttribute('href');
			    url&&(parent.mainFrame.location=url);
		    }
		    
	    },
	    setCur:function(th){
	    	var p = th.parentNode;
	    	if(p){
	    		r=p.childNodes;
	    		util.each(r,function(e){e.className&&(e.className="")});
	    		th.className="cur";
	    	}
	    },
	    displayPag:function(n){
	    	util.each(dis,function(e,i){
	    		e.style.display=(n==i)?'':'none';
	    	});
	    },
	    displayLi:function(n){
	    	util.each(head_li,function(e,i){e.className=(n==i)?'hegh':''})
	    },
	    playHrefList:function(id){
	    	var o = util.$(id);
	    	if(o){
	    		o.style.display=o.style.display=='none'?"":"none";
	    	}
	    }
	}
})();

function filterDis(r){
	var dis = [];
	for(var i=0;i<r.length;i++){
		if(r[i].className=='menupag01'){
			dis.push(r[i]);
			}
		}
	 return dis;	
}

PageLoad.resize();
PageLoad.goAction(0);
